Ext.define('AmpleHarvest.objects.aqb.cWindow', {
	extend		: 'Ext.tab.Panel',
	alias		: 'widget.ampleharvest-objects-aqb-cwindow',
    requires 	: 
		[
		 	"Ext.panel.Panel",
		 	"AmpleHarvest.objects.aqb.search.cSearch",
		 	"AmpleHarvest.objects.aqb.manager.cManager",
		 	"AmpleHarvest.DATA.Store.cManager"
		],
    title		: 'Search',
    width		:700,
    height		:900,
    activeTab	:0,
    
    initComponent	: function()
    {
    	this.m_obj_SearchWin = Ext.create("AmpleHarvest.objects.aqb.search.cSearch");
    	this.m_obj_QueryManager = Ext.create("AmpleHarvest.objects.aqb.manager.cManager");

    	this.items = 
    	[
	    	this.m_obj_SearchWin,
	    	this.m_obj_QueryManager
    	]
    	
    	this.callParent();
console.log('inaqb');
    },
    
    do_Search 		: function()
    {
    	this.loadURL();
    },
    
    loadURL 		: function()
	{
		this.m_obj_OutputWin.loadURL(this.get_Query(),true);
	},
	
	get_Query		:function()
	{
		var obj_Temp = new Object();
		obj_Temp.Json_Query = this.m_obj_SearchWin.get_QueryObject();
		obj_Temp.Json_Query.Sort = this.m_obj_OutputWin.get_SortArray();
		obj_Temp.Json_Query = Ext.encode(obj_Temp.Json_Query);
		
		return  obj_Temp;
	}
});

